package com.miyu.client1.pojo.book;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "book_chapter")
public class BookChapter {
    private String chapterId;
    private String bookId;
    private String chapterSource;
    private Integer chapterNum;
    private String chapterName;
    private String chapterContext;



    @Id
    @Column(name = "chapter_id", nullable = false, length = 32)
    public String getChapterId() {
        return chapterId;
    }

    public void setChapterId(String chapterId) {
        this.chapterId = chapterId;
    }

    @Basic
    @Column(name = "book_id", nullable = true, length = 32)
    public String getBookId() {
        return bookId;
    }

    public void setBookId(String bookId) {
        this.bookId = bookId;
    }

    @Basic
    @Column(name = "chapter_source", nullable = true, length = 255)
    public String getChapterSource() {
        return chapterSource;
    }

    public void setChapterSource(String chapterSource) {
        this.chapterSource = chapterSource;
    }

    @Basic
    @Column(name = "chapter_num", nullable = true)
    public Integer getChapterNum() {
        return chapterNum;
    }

    public void setChapterNum(Integer chapterNum) {
        this.chapterNum = chapterNum;
    }

    @Basic
    @Column(name = "chapter_name", nullable = true, length = 300)
    public String getChapterName() {
        return chapterName;
    }

    public void setChapterName(String chapterName) {
        this.chapterName = chapterName;
    }

    @Basic
    @Column(name = "chapter_context", nullable = true, length = -1)
    public String getChapterContext() {
        return chapterContext;
    }

    public void setChapterContext(String chapterContext) {
        this.chapterContext = chapterContext;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        BookChapter that = (BookChapter) o;
        return Objects.equals(chapterId, that.chapterId) && Objects.equals(bookId, that.bookId) && Objects.equals(chapterSource, that.chapterSource) && Objects.equals(chapterNum, that.chapterNum) && Objects.equals(chapterName, that.chapterName) && Objects.equals(chapterContext, that.chapterContext);
    }

    @Override
    public int hashCode() {
        return Objects.hash(chapterId, bookId, chapterSource, chapterNum, chapterName, chapterContext);
    }
}
